Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 30, 2025

Summary

This PR improves the UX of the auto-approve checkbox by making it expand the options menu when clicked while no options are selected.

Problem

Previously, when no auto-approve options were selected, the checkbox was disabled and clicking it did nothing. This was confusing for users who expected clicking the checkbox to show them the available options.

Solution

  • Added a click handler to the checkbox container that expands the menu when no options are selected
  • The disabled checkbox now acts as a trigger to guide users to select options first
  • Maintains all existing functionality when options are already selected

Changes

  • Modified AutoApproveMenu.tsx to add click handler that expands menu when no options selected
  • Updated test to verify the new behavior

Testing

  • All existing tests pass
  • Added test coverage for the new behavior
  • Manually tested the interaction

Context

This change was requested via Slack: "I think the checkbox should probably pop open the list if nothing is selected - it's a little confusing otherwise"

Fixes the UX confusion by making the interface more intuitive.


Important

Improves UX by expanding the auto-approve options menu when the checkbox is clicked with no options selected in AutoApproveMenu.tsx.

  • Behavior:
    • AutoApproveMenu.tsx: Checkbox now expands options menu when clicked with no options selected.
    • Maintains existing functionality when options are selected.
  • Testing:
    • AutoApproveMenu.spec.tsx: Updated tests to verify menu expansion behavior when no options are selected.
    • All existing tests pass and new test coverage added for the behavior.

This description was created by Ellipsis for 3c480ca. You can customize this summary. It will automatically update as commits are pushed.

- When no auto-approve options are selected, clicking the checkbox area will expand the menu to show available options
- This improves UX by making it clearer how to enable auto-approval features
- Updated tests to verify the new behavior
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 30, 2025 04:32
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. UI/UX UI/UX related or focused labels Aug 30, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing my own code because apparently I trust no one, not even myself.

onClick={toggleExpanded}>
<div onClick={(e) => e.stopPropagation()}>
<div
onClick={(e) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this with keyboard navigation? The click handler on the div wrapper could potentially interfere with keyboard accessibility or screen reader interactions. It might be worth verifying that the checkbox remains fully accessible.

if (!hasEnabledOptions) {
setIsExpanded(true)
}
}}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested click handlers with stopPropagation() create a somewhat complex event flow. Could we simplify this by having a single click handler that checks both conditions? Something like:

Suggested change
}}>
onClick={(e) => {
e.stopPropagation()
// If no options are selected, clicking the checkbox area should expand the menu
if (!hasEnabledOptions) {
setIsExpanded(true)
} else {
// Handle normal checkbox toggle
const newValue = !(autoApprovalEnabled ?? false)
setAutoApprovalEnabled(newValue)
vscode.postMessage({ type: "autoApprovalEnabled", bool: newValue })
}
}}>

const masterCheckbox = screen.getByRole("checkbox")
fireEvent.click(masterCheckbox)
const checkboxContainer = masterCheckbox.parentElement
fireEvent.click(checkboxContainer!)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using parentElement without null checking could be fragile. Consider adding a null check or using a more specific selector:

Suggested change
fireEvent.click(checkboxContainer!)
const checkboxContainer = masterCheckbox.parentElement
if (!checkboxContainer) {
throw new Error('Checkbox container not found')
}
fireEvent.click(checkboxContainer)

vscode.postMessage({ type: "autoApprovalEnabled", bool: newValue })
}
// If no options enabled, do nothing
// If no options enabled, the onClick handler above will expand the menu
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment might be clearer if it mentioned this is the fallback behavior:

Suggested change
// If no options enabled, the onClick handler above will expand the menu
// If no options enabled, the onClick handler above will expand the menu
// (since onChange won't fire for a disabled checkbox)

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 30, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Sep 2, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Sep 2, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Draft / In Progress] in Roo Code Roadmap Sep 3, 2025
@daniel-lxs daniel-lxs marked this pull request as draft September 3, 2025 22:27
@daniel-lxs
Copy link
Member

daniel-lxs commented Sep 3, 2025

This doesn't work currently, tried to fix it but it is kinda janky, we might want to think of a different solution for this.

@daniel-lxs
Copy link
Member

Closing in favor of #7421

@daniel-lxs daniel-lxs closed this Sep 4, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Sep 4, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 4, 2025
@daniel-lxs daniel-lxs deleted the fix/auto-approve-checkbox-expand branch September 4, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR - Draft / In Progress size:S This PR changes 10-29 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants